<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
</head>
<body>
<div id="app">
<!--    1.遍历字符串-->
    <ul>
        <li v-for="(value,key) in str">value:{{value}}---key:{{key}}</li>
    </ul>
<!--    2.遍历数字-->
    <ul>
        <li v-for="(value,key) in num">value:{{value}}---key:{{key}}</li>
    </ul>
<!--    3.遍历数组-->
    <ul>
        <li v-for="(item,index) in arr">item:{{item}}---index:{{index}}</li>
    </ul>
<!--    4.遍历对象-->
    <ul>
        <li v-for="(value,key) in obj">value:{{value}}---key:{{key}}</li>
    </ul>
</div>
<script>
    Vue.config.productionTip = false
    const vm = new Vue({
        el: '#app',
        data() {
            return {
                str:'hello vue',
                num:10,
                arr:['北京','上海','深圳','杭州'],
                obj:{
                    name:'zhangsan',
                    age:18,
                    sex:'男'
                }
            }
        }
    })
</script>
</body>
</html>